package roleDto

// 创建角色请求
type CreateRoleRequest struct {
	Name string `json:"name" binding:"required"`
}

// 角色列表请求
type ListRoleRequest struct {
	Page   int    `form:"page" binding:"required,min=1"`
	Limit  int    `form:"limit" binding:"required,min=1,max=9999"`
	Name   string `form:"name"`
	Status *int   `form:"status"`
}

// 角色列表响应
type ListRoleResponse struct {
	List  []RoleInfo `json:"list"`
	Total int64      `json:"total"`
	Limit int        `json:"limit"`
	Page  int        `json:"page"`
}

type RoleInfo struct {
	Id        int    `json:"id"`
	Name      string `json:"name"`
	Status    int    `json:"status"`
	CreatedAt string `json:"created_at"`
}

// 更新角色请求
type UpdateRoleRequest struct {
	Id   int    `json:"id" binding:"required"`
	Name string `json:"name" binding:"required"`
}

// 更新角色状态请求
type UpdateStatusRequest struct {
	Id     int `json:"id" binding:"required"`
	Status int `json:"status" binding:"required,oneof=0 1"`
}

// 更新角色规则请求
type UpdateGroupRequest struct {
	Id    int   `json:"id" binding:"required"`
	Rules []int `json:"rules" binding:"required"`
}

// 获取用户角色请求
type RoleMyRequest struct {
	AdminId int `json:"admin_id" binding:"required"`
}

// 更新用户角色请求
type UpdateUserRoleRequest struct {
	AdminId int   `json:"id" binding:"required"`
	Roles   []int `json:"roles" binding:"required"`
}
